package Visitor;

import java.util.LinkedList;
import java.util.List;

public class FruitRestraunt {
    List<Fruit> fruitList=new LinkedList<Fruit>();

    void produce()
    {
        fruitList.add(new Apple());
        fruitList.add(new Pear());
        fruitList.add(new Apple());
        fruitList.add(new Pear());
    }
    void welcome(Visitor visitor)
    {
        for(Fruit fruit:fruitList)
        {
            fruit.accept(visitor);
        }
    }
}
